<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('basic',$postdata);
		exi('设置成功');
	}
	$bankuai =array(
		array('title'=>'农产品','img'=>'../core/resource/images/diy/icon/icon-1.png','action'=>'jy_newnong/goods.index/'),
		array('title'=>'果树认领','img'=>'../core/resource/images/diy/icon/icon-2.png','action'=>'jy_newnong/gclassify/'),
		array('title'=>'领券中心','img'=>'../core/resource/images/diy/icon/icon_coupon.png','action'=>'jy_weishop/coupon.index/'),
		array('title'=>'农场监控','img'=>'../core/resource/images/diy/icon/icon-live.png','action'=>'jy_live/list/'),
		array('title'=>'公司简介','img'=>'../core/resource/images/diy/icon/icon-5.png','action'=>'jy_farmer/jianjie/'),
	);
	$footernav =array(
		array('title'=>'首页','icon'=>'icon-shouye','action'=>'jy_newnong/index/'),
		array('title'=>'果树','icon'=>'icon-haoping','action'=>'jy_newnong/gclassify/'),
		array('title'=>'农产品','icon'=>'icon-zidingyileimu','action'=>'jy_newnong/goods.index/'),
		array('title'=>'我的果树','icon'=>'icon-favorite','action'=>'jy_newnong/myguoshu/'),
		array('title'=>'中心','icon'=>'icon-wo1','action'=>'jy_newnong/myhome/'),
	);
	$hdps =array(
		array('title'=>'首页','picurl'=>'../addons/jy_newnong/images/hdp.jpg','url'=>'jy_newnong/index/'),
	);
	$plugins =$this->plugins();
	$return['item']=$this->plugin_setting('basic');
	$return['item']['demofooternav'] = $footernav;
	$return['item']['bankuai']=$return['item']['bankuai']?$return['item']['bankuai']:$bankuai;
	$return['item']['footernav']=$return['item']['footernav']?$return['item']['footernav']:$footernav;
	$return['item']['hdps']=$return['item']['hdps']?$return['item']['hdps']:$hdps;
	$return['item']['plugins']=$return['item']['plugins']?$return['item']['plugins']:$plugins[1]['list'];
	$htmls=array(
		'type'=>'edit',
		'desc'=>'参数设置',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基本信息',
				'list'=>array(
					array('type'=>'string','title'=>'网站名称','name'=>'title'),
					array('type'=>'image','title'=>'网站logo','name'=>'logo'),
					array('type'=>'switch','title'=>'支持美丽天天秒？','name'=>'jy_twojiup','help'=>'开启后，农场消费（种植，领养等等）都按【美丽天天秒】的分销规则'),
					array('type'=>'switch','title'=>'开启独立商品','name'=>'is_onegoods','help'=>'开启后，商品独立化'),
					array('type'=>'switch','title'=>'模板路径到小程序？','name'=>'is_urlwxapp','help'=>'开启后，点击模板消息，跳转到小程序'),
					array('type'=>'string','title'=>'模板路径到小程序ID','name'=>'urlappid'),
					array('type'=>'string','title'=>'分享标题','name'=>'share_title'),
					array('type'=>'image','title'=>'分享图片','name'=>'share_image'),
					array('type'=>'string','title'=>'分享描述','name'=>'share_desc'),
				)
			),
			array(
				'title'=>'收益/配送/自提设置',
					'list'=>array(
						array('type'=>'switch','title'=>'关闭快递配送？','name'=>'down_send_type1','help'=>'这里关闭后，全果树都关闭'),
						array('type'=>'switch','title'=>'关闭门店自取？','name'=>'down_send_type0','help'=>'这里关闭后，全果树都关闭'),
						array('type'=>'string','title'=>'默认配送费','name'=>'peisongfee'),
						array('name'=>'dispatchtype','title'=>'运费设置','type'=>'radio','options'=>'dispatchtype'),
						array('name'=>'template_id','title'=>'运费模版','type'=>'select','options'=>'dispatchid','show'=>array('dispatchtype'=>0),'help'=>'运费模板，统一调用商城体系的！'),
						array('name'=>'dispatchfee','title'=>'统一运费','type'=>'string','show'=>array('dispatchtype'=>1),'help'=>'统一运费后发往各地运费一致'),
						array('type'=>'array','name'=>'stores','add_tip'=>'添加一个自提门店',
							'list'=>array(
								array('type'=>'string','name'=>'title','title'=>'自提门店名称'),
								array('type'=>'string','name'=>'address','title'=>'自提门店地址'),
								array('type'=>'string','name'=>'name','title'=>'联系人'),
								array('type'=>'string','name'=>'mobile','title'=>'联系电话'),
							),
							'details'=>array(
								array('type'=>'string','name'=>'title','title'=>'自提门店名称'),
								array('type'=>'pcd','name'=>'pcd','title'=>'自提门店区域'),
								array('type'=>'lat_lng','name'=>'lat_lng','title'=>'门店坐标'),
								array('type'=>'string','name'=>'address','title'=>'自提门店地址'),
								array('type'=>'string','name'=>'name','title'=>'联系人'),
								array('type'=>'string','name'=>'mobile','title'=>'联系电话'),
							)
						)
					)
			),
			array(
					'title'=>'幻灯片',
					'list'=>array(
						array('type'=>'array','name'=>'hdps','add_tip'=>'添加一个幻灯片',
								'list'=>array(
									array('type'=>'image','name'=>'picurl','title'=>'图片'),	
									array('type'=>'string','name'=>'url','title'=>'地址'),
								),
								'details'=>array(
									array('type'=>'image','name'=>'picurl','title'=>'图片','help'=>'推荐尺寸：自适应'),
									array('type'=>'link','name'=>'url','from'=>'action','title'=>'地址'),
								)
						),
					)
			),
			array(
				'title'=>'板块导航',
					'list'=>array(
									array('type'=>'array','name'=>'bankuai','add_tip'=>'添加一个板块导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'image','name'=>'img','title'=>'导航图片'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'image','name'=>'img','title'=>'导航图片'),							
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
									)
								),
					)
			),
			array(
				'title'=>'底部导航',

					'list'=>array(
									array('type'=>'updemo','name'=>'footernav','demo'=>'demofooternav','title'=>'重置导航','help'=>'不知道添加什么导航？重置默认的一下试试！'),
									array('type'=>'array','name'=>'footernav','add_tip'=>'添加一个底部导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),							
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
									)
								),
					)
			),
		),
	);
	
	$return['dispatchtype']=array('0'=>'运费模板','1'=>'统一运费','2'=>'默认模板');
	$return['dispatchid']=pdo_getall('jy_weishop_dispatch',array('uniacid'=>$_SESSION['uniacid'],'status'=>1),array('id','title'),'id');
	$return['htmls']=$htmls;
	exi($return);
}
